// eee.Sheffield.PZ.Imaging
//
// Copyright ? Ping Zou, 2007
// sg71.cherub@gmail.com
//

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Diagnostics;

namespace eee.Sheffield.PZ.Imaging.ImageIO
{
    /// <summary>
    /// JPEG Image IO
    /// </summary>
    public class JPGImageIO : ImageIO
    {
        #region Constructors
        public JPGImageIO(string fileName) : base(fileName) { }
        public JPGImageIO(string fileName, Bitmap image) : base(fileName, image) { }
        #endregion

        #region interface methods implementation
        public override void LoadImage()
        {
            _image = (Bitmap)Bitmap.FromFile(_fileName);
        }

        public override void SaveImage()
        {
            _image.Save(_fileName, ImageFormat.Jpeg);
        }
        #endregion
    }
}
